//index.js
//获取应用实例
const messageService = require('../../services/messageService');
const Api= require('../../services/api');
const utils= require('../../utils/util');
var app = getApp()
Page({
  data: {
    h5URL:Api.h5URL,
    assets:app.assets,
    assetsByEnv:app.assetsByEnv,
    key:'',
    h5:'',
    openid:'',
    version:''
  },
  // 跳转地址格式/pages/commonWebView/commonWebView?h5=h5routerName&param1=xxx&param2=xxx
  onLoad: function (options) {
      var user = wx.getStorageSync('user');
      this.setData({
          h5:options.h5,
          version:new Date().getTime(),
          key: user?user.key:'',
          openid: user?user.openid:''
      });
      delete options.h5;
      let query = utils.convertObjToUrlQuery(options);
      if (query) {
          query = '&' + query;
      }
      this.setData({
          query: query
      });
  }
});
